<template>
  <User @submit="submit" submit-text="注册" />
</template>

<script setup lang="ts">
import { useUserStore } from "@/store/user";
import User from "./components/user.vue";
const userStore = useUserStore();

const router = useRouter();
async function submit(user: any) {
  await userStore.create(user.account, user.password);
  router.replace("/login");
}
</script>
